<template>
  <div>
    <el-form label-width="80px" label-position="left" :model="searchForm">
      <el-row>
        <el-col :span="8">
          <el-form-item label="用户名">
            <el-input v-model="searchForm.userName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="角色昵称">
            <el-input v-model="searchForm.nickName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="创建时间">
            <el-date-picker
              v-model="searchForm.createTime"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-button @click="onSearch" type="primary">查 询</el-button>
          <el-button @click="reset()">重 置</el-button>
        </el-col>
      </el-row>
    </el-form>
    <page-table
      :data="tableData"
      :total="count"
      :page="pageIndex"
      :pageSize="pageSize"
      ref="pageTable"
      showIndex
      @currentChange="currentChange"
      @sizeChange="sizeChange"
      :loading="loading"
    >
      <el-table-column
          prop="userName"
          label="用户名"
          show-overflow-tooltip
      ></el-table-column>
      <el-table-column
          prop="nickName"
          label="昵称"
          show-overflow-tooltip
      ></el-table-column>
      <el-table-column label="创建时间">
        <template slot-scope="{ row }">
          {{ row.createdAt | timeFilter }}
        </template>
      </el-table-column>
    </page-table>
  </div>
</template>

<script>
import initData from "../../../mixins/initData";
export default {
  name: "userManage",
  mixins: [initData],
  data() {
    return {
      getUrl: "/api/user/user",
      searchForm: {
        userName: "",
        nickName: "",
        createTime: ""
      }
    };
  }
};
</script>

<style scoped></style>
